package com.rc.saas.tenant.service.printer;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.rc.saas.tenant.base.BaseSearch;
import com.rc.saas.tenant.mapper.printer.ElecPrinterStationMapper;
import com.rc.saas.tenant.vo.elecPrinter.ElecPrinterStationResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @author frog
 * @date 2021/08/10
 */
@Service
public class ElecPrinterStationServiceImpl implements ElecPrinterStationService {

    @Autowired
    private ElecPrinterStationMapper elecPrinterStationMapper;

    @Override
    public ElecPrinterStationMapper getMapper() {
        return elecPrinterStationMapper;
    }

    @Override
    public PageInfo<ElecPrinterStationResultVo> listPageElecPrinterStation(BaseSearch baseSearch, Long printerId) {
        PageHelper.startPage(baseSearch.getOffset(), baseSearch.getLimit());
        List<ElecPrinterStationResultVo> elecPrinters = elecPrinterStationMapper.listElecPrinterStation(printerId);
        return new PageInfo<ElecPrinterStationResultVo>(elecPrinters);
    }
}
